package spring.inter.impl;

import spring.inter.Ink;

import java.awt.*;

/**
 * @author 吴阳基
 * @datetime 2024/1/10 9:51
 */
public class GreyInk implements Ink {
    @Override
    public String getColor(int red, int green, int blue) {
        int c = (red + green + blue) / 3;
        Color color = new Color(c, c, c);
        return "#" + Integer.toHexString(color.getRGB()).substring(2); //返回颜色(RGB格式的字符串值)
    }
}
